package com.itheima.factory;

import com.itheima.dao.BookDao;
import com.itheima.dao.impl.BookDaoimpl;
import org.springframework.beans.factory.FactoryBean;

/**
 * @author Xiao
 * @date 2021/9/11
 */
/**FactoryBean创建对象*/
public class bookDaoFactoryBean implements FactoryBean<BookDao> {
    @Override
    //返回Bean对象
    public BookDao getObject() throws Exception {
        return new BookDaoimpl();
    }
    @Override
    //返回Bean对象类型
    public Class<?> getObjectType() {
        return BookDao.class;
    }
    @Override
    //设定单例/非单例
    public boolean isSingleton() {
        return true;
    }
}
